import { LoginAction } from '@/type/store'
import { Token } from '@/type/data'
import { getToken } from '@/utils/storage'
const initialState: Token = getToken()
const login = (state = initialState, action: LoginAction):Token => {
  switch (action.type) {
    case 'login/token':
      return action.payload
    default:
      return state
  }
}

export default login
